{extend name="base" /} {block name="body"}
<div class="layui-body">
	<!--tab标签-->
	<div class="layui-tab layui-tab-brief">
		<ul class="layui-tab-title">
			<li class="">
				<a href="{:url('shop/goods_type')}">分类列表</a>
			</li>
			<li class="layui-this">编辑分类</li>
		</ul>
		<div class="layui-tab-content">
			<div class="layui-tab-item layui-show">
				<form class="layui-form form-container" action="{:url('shop/edit_goodstype')}" method="post">
					<div class="layui-form-item">
						<label class="layui-form-label">上级分类：</label>
						<div class="layui-input-block">
							<select name="pid" class="form-control">
                                <option value="0">一级分类</option>
                                {foreach name="typelist" item="vo"}
                                <option value="{$vo.id}" {if condition="$list.id==$vo.id"} disabled="disabled"{/if} {if condition="$list.pid==$vo.id"} selected="selected"{/if}>{neq 
								name="vo.level" value="1"}|{php}for($i=1;$i<$vo['level'];$i++){echo ' ----';}{/php}{/neq} {$vo.name}</option>
                                {/foreach}
                            </select>
						</div>
					</div>
				<div class="layui-form-item">
					<label class="layui-form-label">分类名称</label>
					<div class="layui-input-block">
						<input type="text" name="name" value="{$list.name}" required lay-verify="required" placeholder="请输入分类名称" class="layui-input">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">分类描述</label>
					<div class="layui-input-block">
						<input type="text" name="description" value="{$list.description}" required lay-verify="required" placeholder="请输入分类描述 " class="layui-input">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">状态</label>
					<div class="layui-input-block">
						<input type="radio" name="status" value="2" title="开启" {if condition="$list.status==2" } checked="checked" {/if}>
						<input type="radio" name="status" value="1" title="关闭" {if condition="$list.status==1" } checked="checked" {/if}>
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">排序</label>
					<div class="layui-input-block">
						<input type="text" name="sort" value="{$list.sort}" required lay-verify="required" class="layui-input">
					</div>
				</div>
					
					<div class="layui-form-item">
						<div class="layui-input-block">
							<input type="hidden" name="id" value="{$list.id}">
							<button class="layui-btn" lay-submit lay-filter="*">更新</button>
							<button type="reset" class="layui-btn layui-btn-primary">重置</button>
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
</div>
<script>
	// 定义全局JS变量
	var GV = {
		current_controller: "{$controller}/goods_type"
	};
</script>
{/block}
{block name="js"}
<script type="text/javascript" src="/public/static/js/image.zip.js"></script>
<script type="text/javascript" src="/public/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="/public/ueditor/ueditor.all.js"></script>

{/block}